package com.binarysoft.service.common.snmp;

import java.io.Serializable;

public class SnmpValue implements Serializable {
	private String objectName = null;
	private String oid = null;
	private String index = "";
	private Object value = null;
	private long timestamp;
	private int valueType = 0;

	@Override
	public int hashCode() {
		return keyString().hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof SnmpValue) {
			SnmpValue sv = (SnmpValue) obj;
			return sv.keyString().equals(this.keyString());
		}
		return false;
	}

	public String getObjectName() {
		return objectName;
	}

	public void setObjectName(String objectName) {
		this.objectName = objectName;
	}

	public String getOid() {
		return oid;
	}

	public void setOid(String oid) {
		this.oid = oid;
	}

	public String getIndex() {
		return index;
	}

	public void setIndex(String index) {
		this.index = index;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public int getValueType() {
		return valueType;
	}

	public void setValueType(int valueType) {
		this.valueType = valueType;
	}

	private String keyString() {
		StringBuffer sb = new StringBuffer();
		sb.append(oid).append(".").append(index);
		return sb.toString();
	}
}
